package main

import (
	"gitee.com/cdsailyj/go-vpn/global"
	"gitee.com/cdsailyj/go-vpn/server"
	"github.com/gin-gonic/gin"
	"os"
)

func main() {
	global.ParseCmd()
	if global.AppEnv == "prod" {
		gin.SetMode(gin.ReleaseMode)
	} else {
		gin.SetMode(gin.DebugMode)
	}

	//加载配置
	global.LoadConfig()
	//设置HTTP代理
	if len(global.CONFIG.GoHttpProxy) > 0 {
		os.Setenv("GO_HTTP_PROXY", global.CONFIG.GoHttpProxy)
	}

	//启动
	server.Run()
}
